﻿#ifndef _slt_tcp_sender_h_20220715
#define _slt_tcp_sender_h_20220715
#include <functional>
#include "SL_tcpClient.h"
#include "SLT_tool_pub_def.h"
#include "SL_asynFramePub.h"

class SLT_TCPSender : public SLF_sender
{
public:
};
typedef std::shared_ptr< SLT_TCPSender> SLT_TCPSenderPtr;

//接收消息回掉函数
typedef std::function<void(uint32_t _dstID, int msgid, uint32_t _srcID,
                    SLF_sendMemBasePtr& _data,const SLF_senderPtr& _senderPtr,SLF_SessionBasePtr &_in_out_sessSptr)>  SLT_tcpRecvMsgCb_type;

//sender接收到数据，没有目标session，回掉通知
SLT_API  void             SLT_setTcpRecvMsgCb(SLT_tcpRecvMsgCb_type _fun);

SLT_API SLT_TCPSenderPtr  SLT_getTcpClientSender(SLTcpClientPtr &_client,const std::string& _rip, uint16_t _rport, bool reuse = true);
SLT_API SLT_TCPSenderPtr  SLT_getTcpServerSender(SLTcpClientPtr& _client);
SLT_API SLT_TCPSenderPtr  SLT_getProxyClientSender(SLTcpClientPtr &_client,const std::string& _rip, uint16_t _rport,
		                int _prefix1, int _prefix2, int _prefix3,int _devno,int _subno,const std::string &_svrid,int _encrypt,int _timeout_ms = 15000);

#endif